<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/wx_main.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/wx_baidu.css?V=5">
<script type="text/javascript" src="__PUBLIC__/Js/jquery.min.js"></script>
<script src="__PUBLIC__/xl/mobiscroll.core-2.5.2.js" type="text/javascript"></script>
<script src="__PUBLIC__/xl/mobiscroll.core-2.5.2-zh.js" type="text/javascript"></script>
<link href="__PUBLIC__/xl/mobiscroll.core-2.5.2.css" rel="stylesheet" type="text/css">
<script src="__PUBLIC__/xl/mobiscroll.datetime-2.5.1.js" type="text/javascript"></script>
<script src="__PUBLIC__/xl/mobiscroll.datetime-2.5.1-zh.js" type="text/javascript"></script>
<script src="__PUBLIC__/xl/mobiscroll.android-ics-2.5.2.js" type="text/javascript"></script>
<link href="__PUBLIC__/xl/mobiscroll.android-ics-2.5.2.css" rel="stylesheet" type="text/css">
<title>小易出行</title>

<script>
$(function () {
	var currYear = (new Date()).getFullYear();
	var opt={};
	opt.date = {preset : 'datetime'};

	//opt.time = {preset : 'time'};
	opt.default = {
		theme: 'android-ics light', //皮肤样式
		display: 'modal', //显示方式
		mode: 'scroller', //日期选择模式
		lang:'zh',
        minDate: new Date(),
        stepHour: 1,
        timeWheels: 'HH:00',
        timeFormat: 'HH:00',

	};
		$("#appDate").scroller('destroy').scroller($.extend(opt['date'],  opt['default']));
		//var optDateTime = $.extend(opt['datetime'], opt['default']);
	//var optTime = $.extend(opt['time'], opt['default']);
	//$("#appTime").mobiscroll(optTime).time(optTime);
	$('#adultsnum').val('');
$('#child').val('');
$('#y').val('');
$('#price').val('');
});

function getAppTime2(){

	$('#adultsnum').val('');
$('#child').val('');
$('#y').val('');
$('#price').val('');
	var appDate = $('#appDate');
	if(appDate.val() == ''){
		appDate.val('请选择预约时间!!!');
	}else{
		var obj = new Array();
		var time = appDate.val();
		obj = time.split(' ');
		obj2 = obj[1].split(':');


		if(obj2[0] >21 || obj2[0] < 5){
			//$('.nextOne3').hide();
            $('#y').val('1');
			error('您选择的时间段为加班车时间段');
		}else{
            $('#y').val('2');
			$('#errorDiv').hide();
			$('.nextOne3').show();
		}
		//appDate.val(appDate.val() +'~'+ (parseInt(obj2[0])+1)+':'+obj2[1]);
		appDate.val(appDate.val());
	}
}

function getPrice(){
  var appDate = $('#appDate').val();
  var from_city = $("#from_city").val();
  var to_city = $("#end_city").val();
  var adultsnum = $('#adultsnum').val();
  var kidsnum   = $('#kidsnum').val();
  var child=$('#child').val();
 var y=$('#y').val();
  $.ajax({
    type: "GET",
    url: "__CONTROLLER__/getprice",
    data: {from_city:from_city, to_city:to_city, adultsnum:adultsnum,child:child,y:y},
    //dataType: "json",
    success:function(data){
      $('#totalprice').html(data+'&nbsp;元');
         $('#price').val(data);

    }
  });}
function error(msg){
	$('#errorDiv').css('display','block');
	$('#error').html(msg);
}
function checkForm(type){
	var appDate = $('#appDate').val();
        var price=$('#price').val();
	var from_address = $('#start').val();
	var to_address = $('#end').val();
	var adultsnum=$('#adultsnum').val();
        var kidsnum=$('#kidsnum').val();
        var price=$('#price').val();
        var crc=$('#crc').val();
        var child=$('#child').val();
	if(appDate ===''){
		error('请选择您的预约时间');
		return false;
	}
	else if(from_address ===''){
		error('请选择您的出发地址');
		return false;
	}
	else if(to_address ===''){
		error('请选择您的到达地址');
		return false;
	}else if(adultsnum ===''){
            error('请输入行程人数');
		return false;

        }
       else if(price ==='' || price==='0'){

                 error('此线路没有开通');
		return false;
    }
else{
    $.ajax({
    type: "POST",
    url: "__CONTROLLER__/addxc",
    data: {start:from_address, end:to_address, price:price,adultsnum:adultsnum, kidsnum:kidsnum,starttime:appDate,crc:crc,child:child},

    success:function(data){
   if(data === '0'){
     window.location.href="__CONTROLLER__/yy/id/1.html" ;

   } else if(data ==='1'){
       alert("未知错误");

   }

    }
  });

}




	return false;
}

</script>
</head>
<body style="text-align:center;">

<div class="topSearch" style="z-index: 10;position: relative;font-size:2em;">
<a onclick="window.history.back()" href="javascript:void(0);"><img src="__PUBLIC__/images/orderlog_03.png"></a>马上约车</div>
<form id="detailform" action="/index.php/Orders/addOrderdone" method="post">
<div class="inputDiv"><img src="__PUBLIC__/images/time.png"><input type="text" name="starttime" id="appDate" onchange="getAppTime2()" value="" readonly="" class="font1" placeholder="预约时间"></div>
<div class="inputDiv"><img src="__PUBLIC__/images/qi.png"><input type="text" name="start" id="start" class="font1" value="{$start}" placeholder="从哪儿出发" readonly="readonly"></a></div>
<div class="inputDiv"><img src="__PUBLIC__/images/zhong.png"><input type="text" name="end" id="end" class="font1" value="{$end}" placeholder="到哪儿去" readonly="readonly"></a></div>
<div class="inputDiv"><span>成人</span><input type="tel" name="adultsnum" id="adultsnum" onkeyup="getPrice()" class="inputMini font3" value="" placeholder="请输入人数">&nbsp;<span style="width:20px;">人;</span><span>儿童</span><input type="tel" name="child" id="child" onkeyup="getPrice()" class="inputMini font3" value="" placeholder="请输入人数">&nbsp;<span style="width:20px;">人</span></div>
<div class="inputDiv"><span>备注</span><input type="text" name="crc" id='crc' class="font1" placeholder="特殊情况"></div>
<div class="inputDiv" id="errorDiv" style="display:none;margin-top:0;"><div id="error" style="line-height:30px;color:#f00;text-align:center;font-size:1.4em;"></div></div>

<div id="totalPirce"></div>
    <input type="hidden" value="" name="y" id="y">
<input type="hidden" value="" name="price" id="price">
<input type="hidden" value="{$from_city}" name="from_city" id="from_city">
<input type="hidden" value="{$end_city}" name="end_city" id="end_city">
<div class="nextOne3" onclick="checkForm(1)">预约司机</div>
<br />
<br />
<div class="inputDiv">
	<ul class="shuoming">
	<li>&nbsp;</li>
    <li>预约说明：</li>
    <li>1、林州市区，新郑机场，郑州三环以内免费接送，超出范围需支付相应燃油费。</li>
    <li>2、正常时间段发车时间为5点，7点，9点，11点，13点，15点，17点，19点，21点。每两小时一班，其他时间段为加班车时间段</li>
    <li>3、为确保及时安排车辆，建议您提前2小时预约。</li>
    <li>4、如有疑问请致电0372-6659666  /  0372-6659888。</li>
	</ul>
</div>
</form>
<div class="jiazai"><img class="jiazai_img" src="__PUBLIC__/images/jiazai.gif"></div>

</body></html>